<template>
<el-row class="login_box">
  <el-col :span="6" :offset="9" style="padding:20px 50px;border-radius:20px;background:lightblue;    box-shadow: 4px 4px 3px #999;">
				<h2 class="login_box_title">XX后台管理系统</h2>
  
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
    <el-form-item prop="name">
	    <el-input id="mobile" v-model="ruleForm.name" placeholder="请输入帐号">
			<template slot="prepend">帐号</template>
		</el-input>
  	</el-form-item>
   
	<el-form-item prop="password">
	    <el-input id="mobile" v-model="ruleForm.password" placeholder="请输入密码">
			<template slot="prepend">密码</template>
		</el-input>
  	</el-form-item>

    <el-form-item>
		<el-button style="width:100%" type="primary" @click="submitForm('ruleForm')">登录</el-button>
    </el-form-item>
</el-form>
</el-col>
		</el-row>
</template>

<script>
export default {
  data() {
    return {
      ruleForm: {
        name: "",
        password: ""
      },
      rules: {
        name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
		password: [{ required: true, message: "请输入密码", trigger: "blur" }]
      }
    };
  },
  methods: {
	   submitForm(formName) {
		   var _this = this;
        this.$refs[formName].validate((valid) => {
          if (valid) {
						_this.$router.push("/home");
          } else {
            return false;
          }
        });
      },
    
    //   
    
  }
};
</script>

<style>
.login_box{
	padding-top: 15%;
}
.login_box_title{
	margin-bottom: 30px;
	text-align: center;
}
.el-form {
  width: 100%;
}
.el-form-item__content{
	margin-left: 0 !important;
}
</style>
